import { defineConfig } from 'vite'
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
import vue from '@vitejs/plugin-vue'
import path from "path";


// https://vite.dev/config/
export default defineConfig({
  plugins: [vue(), cssInjectedByJsPlugin()],
  build: {
    outDir: 'cl-ui',
    cssCodeSplit: false,
    lib: {
      entry: path.resolve(__dirname, 'src/components/index.js'),
      name: 'cl-ui',
      fileName: 'cl-ui'
    },
    rollupOptions: {
      external: ['vue', './public/logo.png'],
      output: {
        globals: {
          vue: 'Vue'
        }
      }
    }
  },
  resolve: {
    alias: {
      '@': '/src'
    }
  }
})
